package com.company.project.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.company.project.entity.TeacherEntity;
import com.company.project.mapper.TeacherMapper;
import com.company.project.service.TeacherService;
import com.company.project.vo.model.StudentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.company.project.mapper.StudentMapper;
import com.company.project.entity.StudentEntity;
import com.company.project.service.StudentService;


@Service("studentService")
public class StudentServiceImpl extends ServiceImpl<StudentMapper, StudentEntity> implements StudentService {
//    TeacherMapper teacherMapper;
    @Autowired
    private TeacherService teacherService;

    public StudentVo getStudentVoById(String id){
        /*StudentEntity student = baseMapper.selectById(id);
        String teacherId = student.getTeacherId();
        TeacherEntity teacher=null;
        if (teacherId!=null){
             teacher =teacherService.getById(teacherId);
        }

        StudentVo vo =new StudentVo();
        *//*vo.setId(student.getId());
        vo.setSex(student.getSex());*//*
        BeanUtil.copyProperties(student,vo);
        vo.setTeacher(teacher);

        return vo;*/
        return baseMapper.selectVoById(id);
    }


}